<template>
  <div id="huishangdiv">
    <div v-if="listLoading" style="margin:20px;">正在加载...</div>
    <div v-else>
        <el-button  @click="pinggushow()" style="right:60px;position:fixed;z-index:999" type="success">查看质量评估</el-button>

      <el-form :model="mydata" label-width="150px" :inline="true" v-if="mydata" id="huiyiyicheng">
          <el-form-item label="会议时间：" style="width:500px;">
            <b>{{mydata.shijian}}</b>
          </el-form-item>
          <el-form-item label="会议地点：" style="width:500px;">
            <b>{{mydata.didian}}</b>
          </el-form-item>
          <div></div>
          <el-form-item label="应到人数：" style="width:500px;clear:both">
            <b>{{mydata.yingdaorenshu}}</b>
          </el-form-item>
          <el-form-item label="实到人数：" style="width:500px;">
            <b>{{mydata.shidaorenshu}}</b>
          </el-form-item>
          <div></div>
          <el-form-item label="主持人：" style="width:1000px;">
            <b>{{mydata.zhuchiren}}</b>
          </el-form-item>
          <el-form-item label="出席人员：" style="width:1000px;">
            <b>{{mydata.chuxirenyuan}}</b>
          </el-form-item>
          <el-form-item label="列席人员：" style="width:1000px;">
            <b>{{mydata.liexirenyuan}}</b>
          </el-form-item>
          <el-form-item label="缺席人员：" style="width:1000px;">
            <b>{{mydata.quexirenyuan}}</b>
          </el-form-item>
          <el-form-item label="缺席人员提交书面发言材料名单：" style="width:1000px;clear:both" label-width="270px">
            <b>{{mydata.quexishumianmingdan}}</b>
          </el-form-item>
      </el-form>
      <el-form v-else style="padding:20px; font-size:14px;color:#999;text-align:center">暂无数据</el-form>
        <div v-if="mydata&&mydata.yicheng&&JSON.parse(mydata.yicheng).length>0">
          <hr style="height:1px;border:0;margin:20px 0;background:#EBEEF5;overflow:hidden">
          <h1>会议议程</h1>
          <el-table :data="JSON.parse(mydata.yicheng)" highlight-current-row v-loading="listLoading" style="width: 100%;" border>
            <el-table-column prop="name" label="议程" width="100">
              <template slot-scope="scope">
                会议议程{{scope.$index+1}}
              </template>
            </el-table-column>
            <el-table-column prop="item" label="主要内容">
              <template slot-scope="scope">
                {{scope.row}}
              </template>
            </el-table-column>
          </el-table>
        </div>
    </div>
  </div>
</template>
<script>
export default {
  props: {
    timestamp: '',
    leaders: []
  },
  data () {
    return {
      files1: [],
      files2: [],
      files3: [],
      files4: [],
      listLoading: false,
      mydata: null,
      pipingren: '',
      beipipingren: '',
      filterList: [],
      sumWenti: 0
    }
  },
  watch: {
    timestamp (val) {
      this.loaddata()
    },
    '$store.state.link_hz' (val) {
      this.activeNameHuishang = this.$store.state.link_hz
    }
    // $refs.tree2.getCurrentNode()
  },
  methods: {
    pinggushow () {
      var params1 = {Link1: 'Pingjia'}
      this.$store.commit('tablink1', params1)
    },
    loaddata () {
      this.listLoading = true
      let para = {
        shenghuohuiunitId: this.$route.params.id,
        pageNum: 1,
        pageSize: 2000
      }
      this.$http
        .post(this.$http.defaults.shenghuohuiAPI + `api/newHsHuiyiyicheng/queryByPage`, para)
        .then(response => {
          this.listLoading = false
          if (response.data.success === true) {
            console.log('获取成功')
            if (response.data.result.records.length > 0) {
              this.mydata = response.data.result.records[0]
            } else {
              this.mydata = null
            }
          } else {
            console.log('获取数据失败:' + response.data.message)
            this.$message({
              message: '获取数据失败:' + response.data.message,
              type: 'error'
            })
          }
        })
        .catch(error => {
          console.log(error)
          this.$message({
            message: '网络获取失败:' + error,
            type: 'error'
          })
          this.listLoading = false
        })
    }
  }
}
</script>
<style scoped>
.el-form-item{
  margin:0;
}
</style>
<style>
#huishangdiv .el-table{
  border: 1px solid #95B8E7 !important;
}
#huishangdiv .el-form-item__label{
  font-size:16px;
}
.chuxi{
  color:green;
}
.nochuxi{
  color:red;
}
#huiyiyicheng .el-form-item__content{
  font-size:16px;
}
</style>
